/**
 * Copyright (c) 1987-2010 Fujian Fujitsu Communication Software Co.,
 * Ltd. All Rights Reserved.
 * This software is the confidential and proprietary information of
 * Fujian Fujitsu Communication Software Co., Ltd.
 * ("Confidential Information"). You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with FFCS.
 * FFCS MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
 * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
 * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. FFCS SHALL NOT BE LIABLE FOR
 * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
 * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
 */
package aip.ui.dictionary.utils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import aip.core.model.dictionary.Dictionary;
import aip.ui.dictionary.srvc.DictionaryFormService;

/**
 * 数据字典固化.
 *
 * @author RUN
 * @version Revision 1.0.0
 */
public class DictionaryUtil {
    /** CET等级 */
    public static final String              DIC_CET_LEVEL      = "CETLevel";
    /** 证书名称 */
    public static final String              DIC_CRED_NAME      = "credentialName";
    /** 证书类别 */
    public static final String              DIC_CRED_TYPE      = "credentialType";
    /** 学位 */
    public static final String              DIC_HIGH_DEGR      = "highestDegree";
    /** 学历 */
    public static final String              DIC_HIGH_EDU       = "highestEducation";
    /** 职位类别 */
    public static final String              DIC_JOB_TYPE       = "jobType";
    /** 专业类别 */
    public static final String              DIC_MAJOR_TYPE     = "majorType";
    /** 政治面貌 */
    public static final String              DIC_POLITY         = "polity";
    /** 笔试专业类别 */
    public static final String              DIC_WRIT_EXAM      = "writtenExaminations";
    /** 工作地点-市 */
    public static final String              DIC_WORKLOC_CITY   = "workingLocationCity";
    /** 工作地点-县 */
    public static final String              DIC_WORKLOC_CNTY   = "workingLocationCounty";
    /** 筛选结果 */
    public static final String              DIC_FILTER_RESULT  = "filterResult";
    /** 应聘者类型 */
    public static final String              DIC_APPLICANT_TYPE = "applicantType";
    /** 笔试结果 */
    public static final String              DIC_WRTN_RESULT    = "writtenExamResult";
    /** 关注级别 */
    public static final String              DIC_CONCERN_LEVEL  = "concern";
    /** 公司工作地点映射 */
    public static final String              DIC_WORKLOC_MAP    = "workLocationMap";
    /** 面试结果 */
    public static final String              DIC_INTE_RESULTS   = "interviewResults";

    /** 是否使用特殊解释方法 */
    public static final Map<String, String> methodMap          = new HashMap<String, String>();
    /** 配置连动 */
    public static final Map<String, String> dictRefMap         = new HashMap<String, String>();
    static {
        methodMap.put(DIC_CRED_NAME, "getCredentialName");
        dictRefMap.put(DIC_CRED_TYPE, DIC_CRED_NAME);
        dictRefMap.put(DIC_WORKLOC_CITY, DIC_WORKLOC_CNTY);
    }

    /**
     * 加载CET等级.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadCETLevels() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_CET_LEVEL);
    }

    /**
     * 加载证书名称.
     *
     * @return
     * @throws Exception
     */
    public static LinkedHashMap<String, ArrayList<String>> loadCredentialNames()
        throws Exception {
        return DictionaryFormService.loadSpecialDict(DIC_CRED_NAME);
    }

    /**
     * 加载证书类别.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadCredentialTypes() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_CRED_TYPE);
    }

    /**
     * 加载学位.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadHighestDegrees() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_HIGH_DEGR);
    }

    /**
     * 加载学位.
     *
     * @return
     * @throws Exception
     */
    public static Map<String, String> loadHighestDegreeMap() throws Exception {
        return DictionaryFormService.loadDictMap(DIC_HIGH_DEGR);
    }

    /**
     * 加载学历.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadHighestEducations() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_HIGH_EDU);
    }

    /**
     * 加载学历.
     *
     * @return
     * @throws Exception
     */
    public static Map<String, String> loadHighestEducationMap()
        throws Exception {
        return DictionaryFormService.loadDictMap(DIC_HIGH_EDU);
    }

    /**
     * 加载专业类别.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadMajorTypes() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_MAJOR_TYPE);
    }

    /**
     * 加载政治面貌.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadPolitys() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_POLITY);
    }

    /**
     * 加载笔试专业类别.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadWrittenExaminations() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_WRIT_EXAM);
    }

    /**
     * 加载职位类别.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadJobTypes() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_JOB_TYPE);
    }

    /**
     * 加载筛选结果.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadFilterResult() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_FILTER_RESULT);
    }

    /**
     * 加载筛选结果.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadApplicantType() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_APPLICANT_TYPE);
    }

    /**
     * 加载笔试结果.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadWrittenExamResult() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_WRTN_RESULT);
    }

    /**
     * 加载关注级别.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadConcern() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_CONCERN_LEVEL);
    }

    /**
     * 加载工作地点－市.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadWorkingLocationCity() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_WORKLOC_CITY);
    }

    /**
     * 加载工作地点.
     *
     * @return
     * @throws Exception
     */
    public static LinkedHashMap<String, ArrayList<String>> loadWorkingLocations()
        throws Exception {
        return DictionaryFormService.loadSpecialDict(DIC_WORKLOC_CNTY);
    }

    /**
     * 加载工作地点映射.
     *
     * @return
     * @throws Exception
     */
    public static String loadStrWorkingLocationMap() throws Exception {
        return DictionaryFormService.loadStrDictionary(DIC_WORKLOC_MAP);
    }

    /**
     * 加载面试结果.
     *
     * @return
     * @throws Exception
     */
    public static List<Dictionary> loadInterviewResults() throws Exception {
        return DictionaryFormService.loadDictionary(DIC_INTE_RESULTS);
    }
}
